package com.eddie.community.service;

import com.eddie.community.entity.DiscussPost;
import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.index.query.QueryBuilders;
import org.elasticsearch.search.SearchHit;
import org.elasticsearch.search.SearchHits;
import org.elasticsearch.search.fetch.subphase.highlight.HighlightBuilder;
import org.elasticsearch.search.fetch.subphase.highlight.HighlightField;
import org.elasticsearch.search.sort.SortBuilders;
import org.elasticsearch.search.sort.SortOrder;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.elasticsearch.core.SearchResultMapper;
import org.springframework.data.elasticsearch.core.aggregation.AggregatedPage;
import org.springframework.data.elasticsearch.core.aggregation.impl.AggregatedPageImpl;
import org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder;
import org.springframework.data.elasticsearch.core.query.SearchQuery;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * Description:es搜索业务
 * Date: 2021/3/4 0004 1:27
 * Author: Eddie.Zhan
 * Email: eddie_zhan@yeah.net
 */
public interface ElasticsearchService {
    //在es服务器保持帖子
    void saveDiscussPost(DiscussPost post);

    //在es服务器删除帖子
    void deleteDiscussPost(int id);

    //在es服务器搜索贴子
    Page<DiscussPost> searchDiscussPost(String keyword, int current, int limit);
}
